<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 1、拷贝对象
        let person1 = {name: "Amy", age: 15}
        // 拓展运算符（...）用于取出参数对象所有可遍历属性然后拷贝到当前对象
        let someone = { ...person1 }
        console.log(someone) //{name: "Amy", age: 15}

        // 2、合并对象
        let age = {age: 15}
        let name = {name: "Amy"}
        let person2 = {...age, ...name}
        console.log(person2) //{age: 15, name: "Amy"}

    </script>
</body>
</html>